/**
 * 
 */
package com.toncen.samepms.tree;

import java.util.List;

import com.toncen.samepms.common.AbstractTreeProvider;
import com.toncen.samepms.system.dao.RoleDao;
import com.toncen.samepms.system.domain.Role;

/**
 * @author tch
 * 
 */
public class RoleTreeProvider extends AbstractTreeProvider<Role> {

	/**
	 * 
	 */
	public RoleTreeProvider() {
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.toncen.samepms.common.AbstractTree#getRoots()
	 */
	public List<Role> getRoots() throws Exception {
		RoleDao roleDao = new RoleDao();
		return roleDao.getAllByState(1);
	}

	/**
	 * @param args
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		RoleTreeProvider moduleTree = new RoleTreeProvider();
		System.out.println(moduleTree.getRoots());
	}

}
